package cn.itcast.bos.dao.base;

import cn.itcast.bos.domain.base.Courier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface CourierRepository extends
        JpaRepository<Courier,Integer>,
        JpaSpecificationExecutor<Courier> {
    @Query(value = "update Courier set deltag='1' where id in:ids")
    @Modifying
    void updateDeltag(@Param("ids") Integer ids);

    /**
     * 查询未关联定区的快递员
     */
//    @Query(value = "from Courier c where c.fixedAreas IS EMPTY")
//    List<Courier> findNoAssociation();
}
